package com.blast.apply.http

import com.lzy.okgo.model.HttpParams
import com.wxl.common.http.OkGoApi
import com.wxl.common.http.SerialHttpCallback
import com.wxl.common.room.entity.UnApplyBlastEntity

class ApplyAuthHttpUtil {

    companion object {

        /**
         * 离线授权申请
         */
        fun underApplyAuth(
            code: String,
            callback: SerialHttpCallback<UnApplyBlastEntity.LicenseFileModel>
        ) {
            val param = HttpParams()
            param.put("action", "getLicenseFile")
            param.put("code", code)
            OkGoApi.api.get().params(param).execute(callback)
        }

        /**
         * 授权
         */
        fun authTrem(
            code: String,
            trem: String,
            fileName: String,
            callback: SerialHttpCallback<String>
        ) {
            val param = HttpParams()
            param.put("action", "postFileDate")
            param.put("randomCode", code)
            param.put("date", trem)
            param.put("filename", fileName)
            OkGoApi.api.get().params(param).execute(callback)
        }
    }
}